<template>
  <view :style="themeColor">
    <view class="page">
      <fu-custom bgColor="bg-white" :isBack="true" :isBottom="true">
        <block slot="content">我的消息</block>
      </fu-custom>

      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myNews_flex_1">
        <view class='flex flex-wrap align-stretch myNews_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/`" v-if="data.article.name!=''">
          <view class='flex flex-wrap align-center myNews_fd1_0_c0'>
            <image class='myNews_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"607.png"'></image>
          </view>
          <template v-for='(item,key0) in data.article.new_msg'>
            <view class='flex flex-direction flex-wrap align-stretch justify-between flex-sub' :key='key0'>
              <view class='flex flex-wrap align-center myNews_fd1_0_c1_c0'>
                <text class='flex-sub myNews_fd1_0_c1_c0_c0'>{{data.article.name}}</text>
                <text class='myNews_fd1_0_c1_c0_c1'>18:20</text>
              </view>
              <text class='myNews_fd1_0_c1_c1'>{{item.title}}</text>
            </view>
          </template>

        </view>
        <template v-for='(item,key0) in data.message'>
          <view class='flex flex-wrap align-stretch myNews_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/`" :key='key0'>
            <view class='flex flex-wrap align-center myNews_fd1_0_c0'>
              <image class='myNews_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"608.png"'></image>
            </view>
            <template v-for='(child,key1) in item.new_msg'>
              <view class='flex flex-direction flex-wrap align-stretch justify-between flex-sub' :key='key1'>
                <view class='flex flex-wrap align-center myNews_fd1_0_c1_c0'>
                  <text class='flex-sub myNews_fd1_1_c1_c0_c0'>{{item.name}}</text>
                  <text class='myNews_fd1_0_c1_c0_c1'>18:20</text>
                </view>
                <text class='myNews_fd1_1_c1_c1'>{{child.title}}</text>
              </view>
            </template>

          </view>
        </template>

        <view class='flex flex-wrap align-center myNews_fd1_2'>
        </view>
        <view class='flex flex-wrap align-stretch myNews_fd1_0'>
          <view class='flex flex-wrap align-center myNews_fd1_0_c0'>
            <image class='myNews_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"609.png"'></image>
            <benben-message-num class='myNews_fd1_3_c0_c1' size='20' color='#fff' background-color='red'>
            </benben-message-num>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch justify-between flex-sub'>
            <view class='flex flex-wrap align-center myNews_fd1_0_c1_c0'>
              <text class='flex-sub myNews_fd1_1_c1_c0_c0'>李先生</text>
              <text class='myNews_fd1_0_c1_c0_c1'>18:20</text>
            </view>
            <text class='myNews_fd1_0_c1_c1'>在吗？</text>
          </view>
        </view>
      </view>




    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "dataList": [],
        "chatList": [],
        "chatMessage": {
          "chat_url": ""
        },
        "data": {
          "article": {
            "category_id": "",
            "name": "",
            "new_msg": [],
            "num": ""
          },
          "message": [],
          "chat": {}
        },
        "partner_id": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        partner_id
      } = options
      if (partner_id !== undefined) this.partner_id = partner_id
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //跳转页面
      goListFunc(type) {
        if (type == '2') {
          this.$urouter.navigateTo(`/pages/wd/orderMessages/orderMessages?id=2`);
        } else if (type == '3') {
          this.$urouter.navigateTo(`/pages/wd/platformAnnouncement/platformAnnouncement`);
        }
      },
      //获取聊天列表
      async getChatFunc() {
        //请求方法
        //数据验证

        let datachatList = await this.$api.post(global.apiUrls.post649aa4a3eba00, {

        });

        if (datachatList.data.code != 1) {
          this.$message.info(datachatList.data.msg);
          return
        }
        let infochatList = datachatList.data;
        this.chatList = infochatList.data

      },
      //获取客服链接
      async getChatMessageFunc(store_id) {
        //请求方法
        //数据验证

        let datachatMessage = await this.$api.get(global.apiUrls.post64897f6fd5486, {
          store_id: store_id
        });

        if (datachatMessage.data.code != 1) {
          this.$message.info(datachatMessage.data.msg);
          return
        }
        let infochatMessage = datachatMessage.data;
        this.chatMessage = infochatMessage.data

        this.dynamicJump(this.chatMessage.chat_url);
      },
      //系统消息-获取消息类型+最新消息
      async getMessageListFunc() {
        //请求方法
        //数据验证

        let datadataList = await this.$api.get(global.apiUrls.post649a96d7625ae, {

        });

        if (datadataList.data.code != 1) {
          this.$message.info(datadataList.data.msg);
          return
        }
        let infodataList = datadataList.data;
        this.dataList = infodataList.data

      },
      //发送请求
      async getListFunc() {
        //请求方法
        //数据验证

        let datadata = await this.$api.get(global.apiUrls.post6424235abdc3c, {
          partner_id: this.partner_id
        });

        if (datadata.data.code != 1) {
          this.$message.info(datadata.data.msg);
          return
        }
        let infodata = datadata.data;
        this.data = infodata.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #fff;
    background-size: 100% auto;
  }

  .myNews_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .myNews_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .myNews_fd0_0_c0_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333;
  }

  .myNews_fd0_0_c0 {
    width: 180rpx;
  }

  .myNews_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .myNews_flex_1 {
    background: #fff;
    background-size: 100% auto !important;
  }

  .myNews_fd1_3_c0_c1 {
    position: absolute;
    top: 0rpx;
    right: 0rpx;
  }

  .myNews_fd1_2 {
    background: rgba(248, 248, 248, 1);
    height: 20rpx;
    background-size: 100% auto !important;
  }

  .myNews_fd1_1_c1_c1 {
    line-height: 33rpx;
    font-size: 24rpx;
    font-weight: 400;
    color: #999999;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .myNews_fd1_1_c1_c0_c0 {
    line-height: 45rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .myNews_fd1_0_c1_c1 {
    line-height: 33rpx;
    font-size: 24rpx;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .myNews_fd1_0_c1_c0_c1 {
    line-height: 28rpx;
    font-size: 24rpx;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .myNews_fd1_0_c1_c0_c0 {
    line-height: 45rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .myNews_fd1_0_c1_c0 {
    margin: 0rpx 0rpx 12rpx 0rpx;
  }

  .myNews_fd1_0_c0_c0 {
    width: 90rpx;
    height: 90rpx;
    border-radius: 45rpx 45rpx 45rpx 45rpx;
  }

  .myNews_fd1_0_c0 {
    margin: 0rpx 32rpx 0rpx 0rpx;
    position: relative;
  }

  .myNews_fd1_0 {
    border-bottom: 1px solid #eee;
    padding: 40rpx 0rpx 40rpx 0rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }
</style>